/*
 * Ch 5.5
 */
class BitSwapReq{
	public BitSwapReq(){
		
	}
	
	public static int bitSwapRequired(int a, int b){
		int count = 0;
		for (int c = a^b; c!=0; c>>=1) {
			count += c & 1; // last bit ?= 1
		}
		return count;
	}
	
	
	public static void main(String[] args) {
		System.out.println(bitSwapRequired(111,222));
	}
	
}